package com.gridmobi.xrtb.model.openrtb24;

import com.gridmobi.xrtb.model.Message;
import com.gridmobi.xrtb.model.RtbBidRequest;

public class OpenRTB24BidRequest extends RtbBidRequest {
	private String id;
	private Imp[] imp;
	private Site site;
	private App app;
	private Device device;
	private User user;
	private int test=0;
	private int at=2;
	private int tmax;
	private String[] wseat;
	private int allimps=0;
	private String[] cur;
	private String[] bcat;
	private String[] badv;
	private String[] bapp;
	private Regs regs;
	private BidRequestExtension ext;

	/**
	 * @return the id
	 */
	public String getId() {
		return id;
	}


	/**
	 * @param id the id to set
	 */
	public void setId(String id) {
		this.id = id;
	}


	/**
	 * @return the imp
	 */
	public Imp[] getImp() {
		return imp;
	}


	/**
	 * @param imp the imp to set
	 */
	public void setImp(Imp[] imp) {
		this.imp = imp;
	}


	/**
	 * @return the site
	 */
	public Site getSite() {
		return site;
	}


	/**
	 * @param site the site to set
	 */
	public void setSite(Site site) {
		this.site = site;
	}


	/**
	 * @return the app
	 */
	public App getApp() {
		return app;
	}


	/**
	 * @param app the app to set
	 */
	public void setApp(App app) {
		this.app = app;
	}


	/**
	 * @return the device
	 */
	public Device getDevice() {
		return device;
	}


	/**
	 * @param device the device to set
	 */
	public void setDevice(Device device) {
		this.device = device;
	}


	/**
	 * @return the user
	 */
	public User getUser() {
		return user;
	}


	/**
	 * @param user the user to set
	 */
	public void setUser(User user) {
		this.user = user;
	}


	/**
	 * @return the test
	 */
	public int getTest() {
		return test;
	}


	/**
	 * @param test the test to set
	 */
	public void setTest(int test) {
		this.test = test;
	}


	/**
	 * @return the at
	 */
	public int getAt() {
		return at;
	}


	/**
	 * @param at the at to set
	 */
	public void setAt(int at) {
		this.at = at;
	}


	/**
	 * @return the tmax
	 */
	public int getTmax() {
		return tmax;
	}


	/**
	 * @param tmax the tmax to set
	 */
	public void setTmax(int tmax) {
		this.tmax = tmax;
	}


	/**
	 * @return the wseat
	 */
	public String[] getWseat() {
		return wseat;
	}


	/**
	 * @param wseat the wseat to set
	 */
	public void setWseat(String[] wseat) {
		this.wseat = wseat;
	}


	/**
	 * @return the allimps
	 */
	public int getAllimps() {
		return allimps;
	}


	/**
	 * @param allimps the allimps to set
	 */
	public void setAllimps(int allimps) {
		this.allimps = allimps;
	}


	/**
	 * @return the cur
	 */
	public String[] getCur() {
		return cur;
	}


	/**
	 * @param cur the cur to set
	 */
	public void setCur(String[] cur) {
		this.cur = cur;
	}


	/**
	 * @return the bcat
	 */
	public String[] getBcat() {
		return bcat;
	}


	/**
	 * @param bcat the bcat to set
	 */
	public void setBcat(String[] bcat) {
		this.bcat = bcat;
	}


	/**
	 * @return the badv
	 */
	public String[] getBadv() {
		return badv;
	}


	/**
	 * @param badv the badv to set
	 */
	public void setBadv(String[] badv) {
		this.badv = badv;
	}


	/**
	 * @return the bapp
	 */
	public String[] getBapp() {
		return bapp;
	}


	/**
	 * @param bapp the bapp to set
	 */
	public void setBapp(String[] bapp) {
		this.bapp = bapp;
	}


	/**
	 * @return the regs
	 */
	public Regs getRegs() {
		return regs;
	}


	/**
	 * @param regs the regs to set
	 */
	public void setRegs(Regs regs) {
		this.regs = regs;
	}


	/**
	 * @return the ext
	 */
	public BidRequestExtension getExt() {
		return ext;
	}


	/**
	 * @param ext the ext to set
	 */
	public void setExt(BidRequestExtension ext) {
		this.ext = ext;
	}

	@Override
	public String toString(){
		StringBuffer sb = new StringBuffer();
		sb.append(this.getId()).append(Message.logDelimiter);
		if (this.getDevice()!=null)
			sb.append(this.getDevice().toString());
		else{
			for (int i=0;i<5;i++)
				sb.append(Message.logDelimiter);
		}
		
		if (this.getApp()!=null)
			sb.append(this.getApp().toString());
		else{
			for (int i=0;i<12;i++)
				sb.append(Message.logDelimiter);
		}
		if (this.getUser()!=null){
			sb.append(this.getUser().toString());
		}{
			for (int i=0;i<5;i++)
				sb.append(Message.logDelimiter);
		}
		if (this.getSite()!=null)
			sb.append(this.getSite().toString());
		else
		{
			for (int i=0;i<3;i++)
				sb.append(Message.logDelimiter);
		}
		Imp[] imps = this.getImp();
		for (int i = 0 ; imps!=null && i<imps.length;i++){
			Imp imp = imps[i];
			if (imp!=null && imp.getBanner()!=null){
				sb.append(imp.getBanner().toString());
			}
		}
		return sb.toString();
	}

}